//
//  LJHBaseCollectionViewCell.m
//  HEARME
//
//  Created by mac on 16/3/1.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "LJHBaseCollectionViewCell.h"

@implementation LJHBaseCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor whiteColor];
        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Mode"] isEqualToString:@"night"]) {
            self.backgroundColor = [UIColor lightGrayColor];
        }
        
    }
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeColor:) name:@"changeColor" object:nil];
    return self;
}
-(void)dealloc
{
    [[NSNotificationCenter defaultCenter] removeObserver:self name:@"changeColor" object:nil];
    [super dealloc];
}

-(void)changeColor:(NSNotification *)notifition
{
    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Mode"] isEqualToString:@"night"])
    {
        self.backgroundColor = [UIColor lightGrayColor];
        
    }
    else
    {
        self.backgroundColor = [UIColor whiteColor];
    }
}


@end
